<?php
header("Content-Type:text/html;   charset=utf8");
error_reporting(0);
$con = mysql_connect("localhost","root","");
mysql_query("SET NAMES 'UTF8'");//防止数据乱码，很重要哦！！！！！
if(!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
$found=$_POST['found'];
mysql_select_db("sign_up", $con);
$result=mysql_query("SELECT * FROM sign_up WHERE name='$found' OR stu_id='$found' OR class='$found' OR tel='$found' OR qq='$found' OR ggroup='$found' ORDER BY class");//读取整个gb.dat文件到数组$list,数组每一个元素为一条留言($list[0]是第一条留言的数据、$list[1]是第一条留言的数据.....

if($result)
{
 while($row = mysql_fetch_array($result))
  {
	?>
<table width='600px' border='1s' cellpadding='1' cellspacing='1'>
<tr>
<th>姓名</th>
<th>学号</th>
<th>班级</th>
<th>电话</th>
<th>qq</th>
<th>组别</th>
</tr>
<tr >
  	<td><?php echo $row['name'] ?></td>
  	<td><?php echo $row['stu_id'] ?></td>
    <td><?php echo $row['class'] ?></td>
    <td><?php echo $row['tel'] ?></td>
    <td><?php echo $row['qq'] ?></td>
    <td><?php echo $row['ggroup'] ?>

  	<a href="delete.php?id=<?php echo $row['id'];?>">删除</a>
  </td>
</tr>
 </table>
<?php 
}
}
else
 echo"没有找到与关键字匹配的信息！";//如果$id＝0则表示没找到匹配，显示相关提示
?>